<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        div{
            width: 800px;
            height: 400px;
            background-color: pink;
            /* 给父亲添加flex */
            display: flex;
            /* 默认的主轴是x轴 */
            flex-wrap: nowrap;
            justify-content: center;
        }
        div span{
            width: 300px;
            background-color: purple;
            margin: 10px;
        }
    </style>
</head>

<body>
    <div>
        <span>1</span>
        <span>2</span>
        <span>3</span>
        <span>4</span>
        <span>5</span>
        <span>6</span>
        <span>6</span>
        <span>6</span>
    </div>
</body>

</html>